import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import '@/styles/index.scss' // global css
import '@/styles/style/theme/index.css' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control
// 引入百度地图
import '@/utils/baiduMap.js'
// 树形选择器
import TreeSelect from '@/components/TreeSelect/index.vue'
import cyTreeSelect from '@/components/TreeSelect/CyTreeSelect.vue'
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}
import BaiduMap from 'vue-baidu-map'

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'PYGGt7wfgyorRicuGvuHybVdQmGbPIq5'
})

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
Vue.use(ElementUI, { zhLocale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false
Vue.component('tree-select', TreeSelect)
Vue.component('cy-tree-select', cyTreeSelect)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
